package com.zc.cityman.service.impl;

import com.zc.cityman.mapper.CitizenMapper;
import com.zc.cityman.pojo.Citizen;
import com.zc.cityman.pojo.User;
import com.zc.cityman.service.ICitizenService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
@Service
public class CitizenServiceImpl implements ICitizenService {
    @Resource
    CitizenMapper citizenMapper;
    @Override
    public List<Citizen> getall() {
        List<Citizen> getall = citizenMapper.getall();
        return getall;
    }

    @Override
    public Integer delmany(List<Integer> ids) {
        Integer delmany = citizenMapper.delmany(ids);
        return delmany;
    }

    @Override
    public List<Citizen> search(String name, Integer age, Date starttime, Date endtime) {
        List<Citizen> search = citizenMapper.search(name, age, starttime, endtime);

        return search;
    }

    @Override
    public int datadel(Integer id,String name) {
        int datadel = citizenMapper.datadel(id,name);
        return datadel;
    }

    @Override
    public int insert(Citizen citizen) {
        int insert = citizenMapper.insert(citizen);
        return insert;
    }

    @Override
    public int change(Citizen citizen) {
        int change = citizenMapper.change(citizen);
        return change;
    }

    @Override
    public List<Citizen> searchByCard(String card) {
        List<Citizen> citizens = citizenMapper.searchByCard(card);
        return citizens;
    }
}
